package com.haiya.responsibilitychain.apply;

public class LeaveApproval {
    public static void main(String[] args) {
        Leader teacher1 = new ClassAdvisor();
        Leader teacher2 = new DepartmentHead();
        Leader teacher3 = new Dean();

        teacher1.setNext(teacher2);
        teacher2.setNext(teacher3);

        System.out.println("小明请假1天~~~~~~~~~~~~");
        teacher1.handleRequest(1);
        System.out.println("小明请假3天~~~~~~~~~~~~");
        teacher1.handleRequest(4);
        System.out.println("小明请假8天~~~~~~~~~~~~");
        teacher1.handleRequest(8);
        System.out.println("小明请假12天~~~~~~~~~~~~");
        teacher1.handleRequest(12);
    }
}
